<?php
namespace Terrafirma\Type;

abstract class AbstractEnumeration
{
	protected $type;
	protected $value;
	
	public function __construct($type) {
		$this->type = $type;
		$this->value = constant(sprintf('%s::%s', get_called_class(), $type));
	}
	
	static public function __callStatic($methodName, $arguments)
	{
		return new static($methodName);
	}
	
	public function getType()
	{
		return $this->type;
	}
	
	public function __toString()
	{
		return (string)$this->value;
	}
}